package chat6;


import java.util.Scanner;


class ArrayUtils {
	static class PairResult {
		private double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
		
}
		
	
	static PairResult findMinMax(double[] values) {
		PairResult PairResult = new PairResult();
		double min = values[0] ; double max = values[0];
		for(int i=0;i <values.length;i++){
			if(values[i]>max)
				max = values[i];
			if(values[i]<min)
				min = values[i];			
		}
		PairResult.max = max;
		PairResult.min = min;		
		return PairResult;	
	}
	
}

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n =sc.nextInt();
		double[] arr = new double[n];
		for(int i=0;i < n; i++){
			arr[i] = sc.nextDouble();
		}
		ArrayUtils m = new ArrayUtils();
		System.out.println(m.findMinMax(arr));
		System.out.println(ArrayUtils.PairResult.class);
		
	}

}
